package robotleMvc.ui.buildEdit
{
	import com.net.AssetData;
	import com.ui.containers.TitleWindow;
	import com.ui.controls.Button;
	import com.ui.controls.List;
	import com.ui.core.Align;
	import com.ui.data.ButtonData;
	import com.ui.data.ListData;
	import com.ui.data.TitleWindowData;
	import com.ui.skin.SkinStyle;
	
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import flash.geom.Rectangle;
	
	import robotleMvc.frameworks.topMenu.event.TopMenuEvent;
	import robotleMvc.ui.SkinType;
	import robotleMvc.ui.TextUtil;
	import robotleMvc.ui.UIUtil;
	import flash.text.TextField;
    


	public class BuildEditView extends TitleWindow
	{
		private var _makeShadowBut:Button;
		private var _buildList:List;
		

		public function BuildEditView(parent:Sprite)
		{
			_data=new TitleWindowData();
			_data.parent=parent;
			initData();
			super(_data);
			addPanels()
			addList();
			addTittleTexts();
		}
		
		private function addTittleTexts():void
		{
			var tittleSprite:Sprite=new Sprite;
			tittleSprite.x=10;
			tittleSprite.y=60;
			addChild(tittleSprite);
			
			var buildName:TextField=TextUtil.getTextField();
			buildName.htmlText="名字";
			buildName.x=50
			tittleSprite.addChild(buildName);
			
			var buildX:TextField=TextUtil.getTextField();
			buildX.htmlText="X";
			buildX.x=160
			tittleSprite.addChild(buildX);
			
			var buildZ:TextField=TextUtil.getTextField();
			buildZ.htmlText="Z";
			buildZ.x=200
			tittleSprite.addChild(buildZ);
		}
		
		private function addPanels():void
		{
		//	UIUtil.addPic(this, 10, 50, 312, 230, UIUtil.blackKuang() )
		}
		private function addList():void
		{
			var data:ListData = new ListData();
			data.width = 350;
			data.height = 200;
			data.cell = BuildEditCell;
			data.parent = this;
			data.hGap=10;
			data.bgAsset = UIUtil.blackKuang();
			data.cellData.upAsset = new AssetData( SkinStyle.emptySkin );
			data.cellData.overAsset = new AssetData( SkinStyle.emptySkin );
			data.cellData.disabledAsset = new AssetData( SkinStyle.emptySkin );
			data.cellData.selected_upAsset = data.cellData.selected_overAsset =  new AssetData( SkinStyle.emptySkin );

			_buildList = new List( data );
			addChild( _buildList );
			_buildList.moveTo( 15, 80 );
			
	
		}

		private function initData():void
		{
			_data.titleBarData.labelData.text="建筑管理器";
			_data.width=400;
			_data.height=320;
			_data.titleBarData.y=30;
			_data.align=Align.CENTER;
			_data.allowDrag=true;
			_data.panelData.bgAsset=windowBg();
			_data.closeButtonData.upAsset=new AssetData(SkinType.CLOSE_UP);
			_data.closeButtonData.downAsset=new AssetData(SkinType.CLOSE_DOWN);
			_data.closeButtonData.overAsset=new AssetData(SkinType.CLOSE_OVER);
		}

		public function windowBg():AssetData
		{
			var inner:Rectangle=new Rectangle(20, 40, 30, 360);
			var assetData:AssetData=new AssetData("frame_out_show");
			assetData.isScaleBitmap=true;
			assetData.inner=inner;
			return assetData;
		}

		public function get buildList():List
		{
			return _buildList;
		}


	}
}
